 <include file="application/home/view/public/header.html"/>
      <!-- /.aside -->
      <section id="content">
        <section class="vbox">
          <section class="scrollable padder">
             <header class="header bg-light bg-gradient b-b">
            <p>首页</p>
          </header>
          <section class="panel panel-default">
              <header class="panel-heading "> 会员升级 </header>
              <form action="{:U('Address/insert')}" method="get" class="form-horizontal" role="form">
                                    <div class="form-group">
										<div class="col-md-2">
											<button  class="btn btn-s-md btn-primary btn-rounded">添加收货地址</button>
										</div>

									</div>
                             </form>
              <div class="table-responsive">
                <table class="table table-condensed table-hover">
					<thead>
					<tr>
						<th class='tt'>收件人</th>
						<th class='tt'>收货地址</th>
						<th class='tt'>邮编</th>
						<th class='tt'>电话</th>
						<th class='tt'>是否默认</th>
						<th class='tt'>操作</th>
					</tr>
					</thead>
					<tbody>
						<foreach name="list" item="vo">
                          <tr>
                            <td class='tt'>{$vo.linkman}</td>
                            <td class='tt'>{$vo.address}</td>
                            <td class='tt'>{$vo.code}</td>
                            <td class='tt'>{$vo.phone}</td>
                            <td class='tt'><eq name="vo.status" value="0">未默认<else/>已默认</eq></td>
                            <eq name="vo.status" value="0">
							<td class='tt' value="123">
								<button class="btn btn-rounded btn-sm btn-twitter">
									<a href="{:U('Address/update',array('address'=>$vo['id']))}">修改</a>
								</button>
								<button class="btn btn-rounded btn-sm btn-facebook" onClick="sub('{$vo.id}')">设为默认</button>
								<button  onClick="del('{$vo.id}')" class="btn btn-rounded btn-sm btn-gplus">删除</button>
								<!-- <a href="{:U('Baodan/jihuoDel',array('id'=>$v['member_id']))}"><input type="button" value="删除用户"></a> -->
							</td>
							<else/>
							<td class='tt'>
								<button class="btn btn-rounded btn-sm btn-twitter">
									<a href="{:U('Address/update',array('address'=>$vo['id']))}">修改</a>
								</button>
								<button onClick="del('{$vo.id}')" class="btn btn-rounded btn-sm btn-gplus">删除</button>
							</td>
							</eq>
                          </tr>
						</foreach>
					</tbody>
					</table>
              </div>
              <footer class="panel-footer">
                <div class="row">
                  <div class="col-sm-4 hidden-xs">
                  <!--  这里不可以删掉 -->
                  </div>
                  <div class="col-sm-4 text-center"> <small class="text-muted inline m-t-sm m-b-sm"></small> </div>
                  <div class="col-sm-4 text-right text-center-xs">
                    <ul class="pagination pagination-sm m-t-none m-b-none">
                      <li>{$page}</li>
                    </ul>
                  </div>
                </div>
              </footer>
            </section>
          </section>
        </section>
        <a href="#" class="hide nav-off-screen-block" data-toggle="class:nav-off-screen" data-target="#nav"></a> </section>
      <aside class="bg-light lter b-l aside-md hide" id="notes">
        <div class="wrapper">Notification</div>
      </aside>
    </section>
  </section>
</section>
<script src="__PUBLIC__/home/js/app.v2.js"></script> <!-- Bootstrap --> <!-- App -->
<script src="__PUBLIC__/home/js/charts/easypiechart/jquery.easy-pie-chart.js" cache="false"></script> 
<script src="__PUBLIC__/home/js/charts/sparkline/jquery.sparkline.min.js" cache="false"></script> 
<script src="__PUBLIC__/home/js/charts/flot/jquery.flot.min.js" cache="false"></script> 
<script src="__PUBLIC__/home/js/charts/flot/jquery.flot.tooltip.min.js" cache="false"></script> 
<script src="__PUBLIC__/home/js/charts/flot/jquery.flot.resize.js" cache="false"></script> 
<script src="__PUBLIC__/home/js/charts/flot/jquery.flot.grow.js" cache="false"></script> 
<script src="__PUBLIC__/home/js/charts/flot/demo.js" cache="false"></script> 
<script src="__PUBLIC__/home/js/calendar/bootstrap_calendar.js" cache="false"></script> 
<script src="__PUBLIC__/home/js/calendar/demo.js" cache="false"></script> 
<script src="__PUBLIC__/home/js/sortable/jquery.sortable.js" cache="false"></script>
<script src="__PUBLIC__/js/layer/layer.js" type="text/javascript"></script>
</body>
</html>	
<script>
//激活
	function sub(id){
		var url = "{:U('Address/Def')}";

		$.post(url,{'id':id},function(data){
			if(data.status == 1){
				layer.msg(data.info);
			}else{
				layer.msg(data.info);
			}
			setTimeout(function () { 
			      	 window.location.reload();
			}, 2000);
		});
	}
//删除
	function del(id){
		var url = "{:U('Address/Del')}";
		layer.confirm('您确定要删除？', {
		  	btn: ['确定','取消'] //按钮
		}, function(){
		  	$.post(url,{'id':id},function(data){
				if(data.status == 1){
					layer.msg(data.info);
				}else{
					layer.msg(data.info);
				}
				setTimeout(function () { 
			      	 window.location.reload();
			    }, 2000);
			});
		}, function(){
		  	
		});
	}
</script>